package com.entities.user.actionscript;

import com.core.ui.actionscript.ActionScriptParser;
import com.core.utils.GlobalConstants;

public class ActionScriptParserUserOpen
        extends ActionScriptParser {

	private String userId = null;



	public void setUserId ( String value ) {

		userId = value;
	}



	public String parseActionScriptParam ( com.model.KeyValue scriptParam ) {

		String result = null;
		if ( GlobalConstants.ACTIONSCRIPT_USERINFO_PARAM_KEY.equalsIgnoreCase(scriptParam.getUserInfo()) ) {
			result = String.format("id=%s", this.userId);
		} else if ( GlobalConstants.ACTIONSCRIPT_USERINFO_PARAM_FORM.equalsIgnoreCase(scriptParam.getKey()) ) {
			result = "EditForm";

		} else {
			result = scriptParam.getValue();
		}
		return result;
	}



	public String entityIdentifierName () {

		return "id";
	}

}
